package com.java1412.controller;

import com.java1412.generator.tables.pojos.Users;
import com.java1412.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author java1412
 * @create 2021-05-20 14:12
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/{id}")
    public Users findUserById(@PathVariable("id") Integer id) {
        return userService.selectById(id);
    }
}